$(document).ready(function(){
	
	//判断design pattern 的uri是否为空，是则让添加按钮不可点
	var dpUri = $("input[name='designPatternUri']").val();
	if (dpUri==""){
		$("#add_design_pattern_component").addClass("disabled").attr("data-target","");
	}

	$("#save_design_pattern_component").click(function(){
		$("#design_pattern_component_panel").modal('hide');
		
		//var 
		//$.post('/ManEnv/designPatternComponent/add',
		//			{dpiFileName:fileName,  name:'equipment',value:equipmentValue},
		//			function(){
		//				alert("success");
		//});
		
	});
	
	$("#design_pattern_component_panel").on('hide',function(){
		//$.post('/ManEnv/designPatternComponent/add',
			//	{dpiFileName:fileName,  name:'equipment',value:equipmentValue},
			//	function(){
			//		alert("success");
				//});
	});
	
	//删除
//	$("a[name='delete_equipment']").click(function(){
//		var fileName = $("input[name='dpiFileName']").val();
//		var equipmentValue = $(this).siblings('input').val();
//		$.post('/ManEnv/busDesignPattern/delete',
//				{dpiFileName:fileName,  name:'equipment',value:equipmentValue},
//				function(){
//					alert("success");
//				});
//		//找到tr,把整行删除
//		$(this).parent().parent().parent().remove();
//	});
	
	
	
});